package com.itboye.ihomebank.adapter;

import java.util.List;

import android.content.Context;
import android.text.InputType;
import android.text.style.TypefaceSpan;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;

import com.itboye.ihomebank.R;
import com.itboye.ihomebank.bean.HeTongBean;
import com.itboye.ihomebank.support.commonadapter.MutiplyCommonAdapter;
import com.itboye.ihomebank.support.commonadapter.ViewHolder;

/***
 * 示例adapter
 * 
 * @author mr.w
 * 
 */
public class HeTongAdapter extends MutiplyCommonAdapter<HeTongBean> {

	int position;

	public HeTongAdapter(Context context, List<HeTongBean> datas,
			int... layoutId) {
		super(context, datas, layoutId);
		// TODO Auto-generated constructor stub

	}

	@Override
	public int getItemViewType(int position) {
		// TODO Auto-generated method stub

		return 0;
	}

	@Override
	public void convert(ViewHolder holder, HeTongBean t, int type,
			final int position) {
		// TODO Auto-generated method stub
		//5、整型     1、字符串    4、日期   0、点击进去 2、签字
		
		holder.setText(R.id.txt, t.getAlias());
		if (t.getDesc() != null) {
			if (!t.getDesc().equals("")) {
				holder.setHint(R.id.edit, t.getDesc());
			}else{
//				holder.setVisible(R.id.edit, false);
			}
		} else {
//			holder.setVisible(R.id.edit, false);
		}
		if(t.getValueType()!=null){
			if(t.getValueType().equals("1")){
				holder.setInputType(R.id.edit,InputType.TYPE_CLASS_TEXT);
			}else if(t.getValueType().equals("2")){
				holder.setInputType(R.id.edit,InputType.TYPE_CLASS_TEXT);
			}else if(t.getValueType().equals("3")){
				holder.setInputType(R.id.edit,InputType.TYPE_CLASS_TEXT);
			}else if(t.getValueType().equals("4")){
				holder.setInputType(R.id.edit,InputType.TYPE_CLASS_TEXT);
			}else if(t.getValueType().equals("5")){
				holder.setInputType(R.id.edit,InputType.TYPE_CLASS_NUMBER);
			}
		}
	}

	@Override
	public void getItemPosition(int position) {
		// TODO Auto-generated method stub
		this.position = position;
	}

}
